package com.dongbao.entity;

import com.dongbao.data.Datacenter;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * Mq消息发送实体
 * */
@Data
public class MqMessage {

    /**
     * 发送消息code值 每个code对应着一种消息种类
     * */
    private Integer code;

    /**
     * 消息内提示信息
     * */
    private String Message;

    /**
     * 消息内包含的行数据
     * */
    private List<Object> rows;

    /**
     * 消息内包含的实体对象类
     * */
    private Object data;

    /**
     * 发送者ip
     * */
    private String autoIp;

    /**
     * 发送者时间
     * */
    private Date sendDateTime;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return Message;
    }

    public void setMessage(String message) {
        Message = message;
    }

    public List<Object> getRows() {
        return rows;
    }

    public void setRows(List<Object> rows) {
        this.rows = rows;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getAutoIp() {
        return autoIp;
    }

    public void setAutoIp(String autoIp) {
        this.autoIp = autoIp;
    }

    public Date getSendDateTime() {
        return sendDateTime;
    }

    public void setSendDateTime(Date sendDateTime) {
        this.sendDateTime = sendDateTime;
    }

    public static MqMessage getInstance(){
        MqMessage message=new MqMessage();
        message.setAutoIp(Datacenter.clientIp);
        message.setSendDateTime(new Date());
        return message;
    }


}
